package com.dynabook.ems.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dynabook.ems.model.bo.OldMachineMessageBO;
import com.dynabook.ems.model.dto.*;
import com.dynabook.ems.model.entity.EmsMainEngine;
import com.dynabook.ems.model.vo.*;
import com.dynabook.ems.model.vo.detailMachine.DetailMachine;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;

/**
 * @author tester
 * @description 针对表【ems_main_engine】的数据库操作Service
 * @createDate 2025-06-05 14:58:22
 */

public interface EmsMainEngineService extends IService<EmsMainEngine> {
    Boolean updateEmsMainEngine(List<EmsDataDTO> list);

    String getFixNo();

    Page<ReceiptListVO> getReceiptList(ReceiptPageDTO receiptPageDTO);

    ReceiptUpdateDTO getSingleMachine(String fixNO);

    Boolean updateReceiptData(ReceiptUpdateDTO receiptUpdateDTO);

    Boolean updateMachineList(UpdateMaicheListDTO updateMaicheListDTO);

    Boolean Receipt(FixNoDTO fixNoDTO);

    DetailMachine getDetailMachine(String fixedNo);

    CategoryMachine getCategoryByItemCode(String itemCode);


    Boolean updateUserName();

    Page<MachineListVO> getMachineList(MachineListDTO machineListDTO);

    boolean handleMissingItems(List<ItemCodeVO> itemCodeList);
    
    /**
     * 根据样品型号分页查询样品列表
     * @param request 查询请求
     * @return 样品列表
     */
    Page<SampleListVO> getSampleListByType(SampleListRequest request);
    
    /**
     * 根据工单号分页查询绑定的样品列表
     * @param request 查询请求
     * @return 样品列表
     */
    Page<SampleListVO> getSampleListByWorkOrder(WorkOrderSampleListRequest request);
    
    /**
     * 工单选择样品
     * @param request 选择样品请求
     * @return 操作结果
     */
    Boolean selectSamplesForWorkOrder(WorkOrderSelectSampleRequest request);
    
    /**
     * 取消工单
     * @param workOrderNumber 工单号
     * @return 操作结果
     */
    Boolean cancelWorkOrder(String workOrderNumber);
    
    /**
     * 分页查询成品列表
     * @param request 查询请求
     * @return 成品列表
     */
    Page<ProductListVO> getProductList(ProductListRequest request);
    
    /**
     * 分页查询旧品入库列表
     * @param request 查询请求
     * @return 旧品列表
     */
    Page<ProductListVO> getOldProductList(ProductListRequest request);

    Boolean deleteReceiptData(@Valid DeleteReceiptRequest deleteReceiptRequest);

    Boolean deleteReceiptDataBatch(@Valid DeleteReceiptRequest deleteReceiptRequest);

    Boolean isExistSn(String sn);

    Boolean isExistTypeAndSerialNumber(String type, String oaRequestId);

    OldMachineMessageBO getSameMessage(String modelType);

    void exportInventoryData(String startDate, String endDate, HttpServletResponse response);
    
    /**
     * 分页查询盘点数据（API接口）
     * @param request 分页查询请求
     * @return 分页查询结果（根据type返回不同类型的PageData）
     */
    Object getInventoryDataPage(InventoryDataPageRequest request);
    
    /**
     * 查询料件基本资料
     * @param request 查询请求（包含PN料号）
     * @return 料件基本资料列表
     */
    List<InventoryExportVO> getMaterialInfo(MaterialInfoRequest request);
}
